[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
twABSpotOff( nSpotNo )
----------------------------------------------------------------------------
twABSpotOff() and the related function twABSpotOn() are used to
disable and enable mouse action on an area of the screen defined
by nSpotNo. These functions are useful if, for instance, you are
calling another function on an ActionKey which also uses mouse hot
spots. If you have a hotspot in the called function which overlies
the region defined by a previous one, you may want to temporarily
suspend some spots while you use others. The spots are retained in
memory but no action is taken when a mouse click occurs in the
region of the spot when it is disabled. When you leave the calling
function, turn the old spots back on.
Arguments:
nSpotNo - 'N' Handle of the hot spot to be disabled.
Return:
NIL
Example:
FUNCTION MyBrowse( wT, wL, wB, wR )
LOCAL aSpots := {}, nChoice := 0, aArray, aActionKeys := {}
LOCAL nCount
// add the action keys
AADD( aActionKeys, { K_F2, {|| ListCodes( 5, 5, 10, 25, aSpots) } })
// add a hot spot to call a picklist function.
AADD( aSpots, twABHotSpot( 24, 0, 24, 12, ;
{|| ListCodes( 5, 5, 10, 25, aSpots) },
1,, .T. )
// add more spots as needed
aArray := twDIRECTORY("*.*", "D")
ASORT( aArray,,, {|x,y| x[1] < y[1]} )
// display a message for the hot spots.
twInfoLine( -2, ".F2..List Codes", "P" )
// Call the browse.
nChoice := twABBrowse( wT, wL, wB, wR, aArray,
"Directory of Files in " + CURDIR() ;
,{"The;File;Name",;
"File;Size",;
"File;Date",;
"File;Time",;
"File;Attribute"};
,, .T., aActionKeys, ;
"bg+/rg,gr+/n,,bg+/rg,n/w", ;
3, 1, "gr+/g", .T., .T., 1, .T. )
// pop the message
twAMPop()
// release hot spots
FOR nCount = 1 TO LEN( aSpots )
twABRemHotSpot( nCount )
NEXT
RETURN nChoice
.........
......... other code
.........
.........
// this function may be in a separate PRG.
FUNCTION ListCodes( wT, wL, wB, wR, aFirstSpots )
LOCAL nCount, aSecondSpots := {}
// disable passed spots.
FOR nCount = 1 TO LEN( aFirstSpots )
twABSpotOff( nCount )
NEXT
// set up the new spots.
AADD( aSecondSpots, twABHotSpot( 24, 0, 24, 12, ;
{|| Help() }, 1,, .T. )
// more spots etc.
// call another browse of the same or different type
twBRBrowse( .......
// Release second set of spots
FOR nCount = 1 TO LEN( aSecondSpots )
twBRRemHotSpot( nCount )
NEXT
// enable old spots
FOR nCount = 1 TO LEN( aFirstSpots )
twABSpotOn( nCount )
NEXT
RETURN .T. // or whatever.
See Also:
twABHotSpot()
twABBrowse()
twABSpotOn()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson